package com.runshu.newsmartark.mvp.model;

import com.runshu.newsmartark.common.ConstantUrl;
import com.runshu.newsmartark.entity.CategoryListEntity;
import com.runshu.newsmartark.entity.UserInfoEntity;
import com.runshu.newsmartark.mvp.contract.ProductTypeDtaContract;
import com.runshu.newsmartark.network.netbean.HttpRequestParamsBuilder;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.BaseCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/11/2
 * @decs：
 */

public class ProductTypeDtaModel extends BaseModel implements ProductTypeDtaContract.Model {
    @Override
    public void getCategoryList(String macAddress,int type, BaseCallBack baseCallBack) {

        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("macAddress", macAddress);
        builder.putParams("type", type);
        super.initDataFromServer(ConstantUrl.GET_CategoryList, builder.build(), CategoryListEntity.class, ResponseBean.RES_DATATYPE_BEANLIST, baseCallBack);

    }

    @Override
    public void getStockSel(String macAddress, int type, BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("macAddress", macAddress);
        builder.putParams("type", type);
        super.initDataFromServer(ConstantUrl.GET_StockSel, builder.build(), CategoryListEntity.class, ResponseBean.RES_DATATYPE_BEANLIST, baseCallBack);

    }

    @Override
    public void getManufacturerSel(String macAddress, int type, BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("macAddress", macAddress);
        builder.putParams("type", type);
        super.initDataFromServer(ConstantUrl.GET_ManufacturerSel, builder.build(), CategoryListEntity.class, ResponseBean.RES_DATATYPE_BEANLIST, baseCallBack);

    }

    @Override
    public void getModelSel(String macAddress, int type, BaseCallBack baseCallBack) {
        HttpRequestParamsBuilder builder = new HttpRequestParamsBuilder();
        builder.putParams("macAddress", macAddress);
        builder.putParams("type", type);
        super.initDataFromServer(ConstantUrl.GET_ModelSel, builder.build(), CategoryListEntity.class, ResponseBean.RES_DATATYPE_BEANLIST, baseCallBack);

    }
}